<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>LcsdAdmin</title>
    <link rel="stylesheet" href="__LAYUI__/css/layui.css">
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <!-- 顶部区域 -->
    {include file="common/header" /}
    <!-- 垂直导航菜单区域 -->
    {include file="common/left" /}
    <!-- 内容主体区域 -->
    <div class="layui-body" style="padding: 10px">
        <!-- 按钮区域 -->
        <div class="layui-btn-group">
            <button type="button" class="layui-btn layui-btn-sm">
                <i class="layui-icon"></i>
            </button>
            <button type="button" class="layui-btn layui-btn-sm">
                <i class="layui-icon"></i>
            </button>
            <button type="button" class="layui-btn layui-btn-sm">
                <i class="layui-icon"></i>
            </button>
        </div>
        <!-- 列表区域 -->
        <table class="layui-hide" id="list"></table>
        <script type="text/html" id="barDemo">
            <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a>
            <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
        </script>
    </div>
    <!-- 底部主体区域 -->
    {include file="common/footer" /}
</div>
<script src="__LAYUI__/layui.js"></script>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;
    });
    layui.use('table', function(){
        var table = layui.table;
        table.render({
            elem: '#list'
            ,url:'/admin.php/index/getCategory'
            ,cols: [[
                {type: 'checkbox', fixed: 'left'}
                ,{field:'id', width:80, title: 'ID', sort: true}
                ,{field:'name', width:180, title: '名称'}
                ,{field:'level', width:80, title: '等级' }
                ,{fixed: 'right', width:180, title:'操作', toolbar: '#barDemo'}
            ]]
            ,page: true
        });
    });
</script>
</body>
</html>